/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.suspend.b.b;

import android.annotation.SuppressLint;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.text.TextUtils;
import org.apache.http.HttpHost;

public class b {
    public static String a(Context paramContext) {
        if (paramContext == null)
            return null;
        String str = null;
        ConnectivityManager localConnectivityManager = (ConnectivityManager) paramContext
                .getSystemService("connectivity");
        try {
            NetworkInfo localNetworkInfo = localConnectivityManager.getActiveNetworkInfo();
            if ((localNetworkInfo != null) && (localNetworkInfo.isAvailable()))
                str = localNetworkInfo.getExtraInfo();
        } catch (Exception localException) {
            localException.printStackTrace();
        }
        return str;
    }

    public static int b(Context paramContext) {
        int i = -1;
        try {
            if (paramContext == null)
                return i;
            ConnectivityManager localConnectivityManager = (ConnectivityManager) paramContext
                    .getSystemService("connectivity");
            if (localConnectivityManager == null)
                return i;
            NetworkInfo localNetworkInfo = localConnectivityManager.getActiveNetworkInfo();
            if ((localNetworkInfo != null) && (localNetworkInfo.isAvailable()))
                i = localNetworkInfo.getType();
        } catch (Exception localException) {
            localException.printStackTrace();
            return i;
        } catch (Throwable localThrowable) {
            localThrowable.printStackTrace();
            return i;
        }
        return i;
    }

    @SuppressLint({ "DefaultLocale" })
    public static HttpHost a(String paramString) {
        if (!(TextUtils.isEmpty(paramString))) {
            String str = paramString.toLowerCase();
            if ((str.startsWith("cmwap")) || (str.startsWith("3gwap")))
                return new HttpHost("10.0.0.172", 80);
            if (str.startsWith("uniwap"))
                return new HttpHost("10.0.0.172", 80);
            if (str.startsWith("ctwap"))
                return new HttpHost("10.0.0.200", 80);
        }
        return null;
    }

    public static HttpHost c(Context paramContext) {
        return a(a(paramContext));
    }
}